package com.spzx.product.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.annotation.Excel;
import com.spzx.common.core.web.domain.BaseEntity;

import java.util.List;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 商品分类
 * </p>
 *
 * @author atguigu
 * @since 2024-10-26
 */
@Schema(description = "商品分类")
@TableName("category")
@Getter
@Setter
public class Category extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 分类名称
     */
    @Excel(name = "分类名称")
    @Schema(description = "分类名称")
    private String name;

    @Excel(name = "图标地址")
    @Schema(description = "图片地址")
    private String imageUrl;

    /**
     * 父分类id
     */
    @Excel(name = "上级分类id")
    @Schema(description = "父分类id")
    private Long parentId;

    /**
     * 是否显示[0-不显示，1显示]
     */
    @Excel(name = "是否显示",readConverterExp = "0=不显示,1=显示")
    @Schema(description = "是否显示")
    private Byte status;

    /**
     * 排序
     */
    @Schema(description = "排序")
    private Integer orderNum;

    @Schema(description = "是否有子节点")
    @TableField(exist = false)
    private Boolean hasChildren;

    @Schema(description = "子节点列表")
    @TableField(exist = false)
    private List<Category> children;
}
